﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/ContentMaster.master" AutoEventWireup="true"
    CodeFile="TreeView.aspx.cs" Inherits="Demos_Menu_TreeView" %>
<asp:Content ID="C1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH1" Runat="Server">
    <telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                    <telerik:AjaxUpdatedControl ControlID="RadDock1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="menuSaveBtn">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                    <telerik:AjaxUpdatedControl ControlID="RadDock1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="menuCancelBtn">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadDock1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadTreeView EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true"
        MultipleSelect="true" runat="server" ID="RadTreeView1" OnNodeDrop="RadTreeView1_NodeDrop"
        OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"
        Height="460" Width="300">
        <ContextMenus>
            <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server">
                <Items>
                    <telerik:RadMenuItem Value="Add" Text="添加节点" CssClass="icon-add" />
                    <telerik:RadMenuItem Value="Edit" Text="编辑节点" CssClass="icon-edit" />
                    <telerik:RadMenuItem Value="Delete" Text="删除节点" CssClass="icon-delete" />
                </Items>
            </telerik:RadTreeViewContextMenu>
        </ContextMenus>
    </telerik:RadTreeView>
    <telerik:RadDock ID="RadDock1" runat="server" Width="330" Title="添加节点" DockMode="Floating"
        EnableRoundedCorners="true" Top="10%" Left="10%" Visible="false">
        <ContentTemplate>
            <p>
                <asp:HiddenField runat="server" ID="menuId" Value="0" />
                <asp:HiddenField runat="server" ID="menuParentId" Value="0" />
                <telerik:RadTextBox runat="server" ID="menuNameBox" Label="显示名称：" LabelCssClass="blkLabel80"
                    EmptyMessage="输入名称" Width="300" /><br />
                    <asp:RequiredFieldValidator runat="server" ID="namev" ControlToValidate="menuNameBox" ErrorMessage="*名称必须填写" /></p>
            <p>
                <telerik:RadTextBox ID="menuUrlBox" runat="server" EmptyMessage="输入地址" Label="链接地址："
                    LabelCssClass="blkLabel80" Width="300" /></p>
            <p>
                <telerik:RadComboBox ID="menuIconBox" runat="server" EmptyMessage="选择图标" Label="显示图标："
                    LabelCssClass="fl-left blkLabel60 " Width="150" Height="200">
                    <HeaderTemplate>
                        图片
                    </HeaderTemplate>
                    <ItemTemplate>
                        <img src="<%# DataBinder.Eval(Container, "value") %>" />
                        <%# DataBinder.Eval(Container, "text") %>
                    </ItemTemplate>
                </telerik:RadComboBox>
            </p>
            <p>
                <telerik:RadButton ID="menuSaveBtn" runat="server" Text="保存" OnClick="RadSave_Click" />
                <telerik:RadButton ID="menuCancelBtn" runat="server" Text="取消" OnClick="RadCancel_Click" CausesValidation="false" />
            </p>
        </ContentTemplate>
    </telerik:RadDock>
</asp:Content>